#include"Myvector.h"
void InitVector(vector* vec)
{
    vec->capacity = 4;
    vec->size = 0;
    vec->head = (type1*)malloc(sizeof(type1) * vec->capacity);
}
void Push(vector* vec, type1 val)
{
    CheckCapa(vec);
    vec->head[vec->size++] = val;
}
void DestroyVec(vector* vec)
{
    for(int i = 0;i<vec->size;i++)
    {
        free(vec->head[i]);
        vec->head[i] == NULL;
    }
    free(vec->head);
    vec->capacity = 0;
    vec->size = 0;
    vec->head = NULL;
}
ob_int CheckCapa(vector* vec)
{
    if(vec->capacity == vec->size)
    {
        vec->capacity *= 2;
        vec->head = realloc(vec->head, sizeof(type1)*vec->capacity);
    }
}